package main

import (
	"fmt"
	"strings"
	"unicode/utf8"
)

func main() {
	s := "i love 中国, 你好 world"
	fmt.Printf("len(s): %#v\n", len(s))
	fmt.Printf("len([]byte(s)): %#v\n", len([]byte(s)))
	fmt.Printf("len([]rune(s)): %#v\n", len([]rune(s)))

	fmt.Printf("utf8.RuneCount([]byte(s)): %#v\n", utf8.RuneCount([]byte(s)))
	fmt.Printf("utf8.RuneCountInString(s): %#v\n", utf8.RuneCountInString(s))

	s2 := "abcdef"
	fmt.Println(strings.TrimLeft(s2, "abc")) //def    因为trim的是cutset - 割集
	fmt.Println(strings.TrimLeft(s2, "cba")) //def    因为trim的是cutset - 割集
}
